﻿@model BusinessManagementStudio.ViewModel.CompanyOrder

@{
    ViewBag.Title = "OrderConfirmation";
    TempData.Keep();
}

<title>Order Confirmation</title>

<h2>Order Confirmation</h2>

@using (Html.BeginForm("MultipleCommand", "Order"))
{
    @Html.ValidationSummary(true)
    
    if (Model.IsUploaded == true)
    {
        <p>The folllowing order(s) is(are) uploaded successfully:</p>
        <table>
            <tbody>
                @if(Model.orderList != null)
                {
                    foreach (var item in Model.orderList)
                    {
                        if(item.CompanyType == "7")
                        { 
                            <tr>
                                <td>@item.ServiceOrderNo</td>
                            </tr>
                        }
                        else if(item.CompanyType == "3")
                        {
                            <tr>
                                <td>@item.FMCode - @item.QuotationNo</td>
                            </tr>
                        }
                    }
                } 
            </tbody>
        </table>
    }
    
    <br />
    <div>
        <button type="submit" name="Command" value="BackToMainMenu">Back To Main Menu</button> 
    </div>
}
